﻿<%@ Page Language="C#" MasterPageFile="~/web.master" AutoEventWireup="true" CodeBehind="SPADA_file_upload.aspx.cs" Inherits="Shuba.Web.bulk_upload.SPADA_file_upload" %>
<asp:Content ID="Header1" ContentPlaceHolderID="HeaderPlaceHolder" runat="server">
<script language="javascript">
    function AddDeleteRow(tbl, act) {
        this.iCounter = 1;
        /*var a = getElementById('imgRemove');
        
        if(tbl.rows.length > 1)
            a.style.visibility = 'visible';
        else
            a.style.visibility = 'hidden';*/
            
        if (act == 'a') {
            newrow = tbl.insertRow();
            newcell = newrow.insertCell();
            newcell.className = tbl.rows[1].cells[0].className;

            var cellcontent = tbl.rows[1].cells[0].innerHTML;
            newcell.innerHTML = cellcontent;
            newcell.align = "right";

            // cell ke 2
            newcell = newrow.insertCell();
            newcell.className = tbl.rows[1].cells[1].className;

            var cellcontent1 = tbl.rows[1].cells[1].innerHTML;

            iCounter++;
            
            cellcontent1 = cellcontent1.replace("txtFilex", "txtFile" + iCounter);
            newcell.innerHTML = cellcontent1;
        }
        else {
            if (tbl.rows.length > 2) {
                tbl.deleteRow(tbl.rows.length - 1);

                if (iCounter > 1) {
                    iCounter--;
                }
            }
        }
    }

</script>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="text" border="0" width="100%" cellspacing="0" cellpadding="2">
	    <tr>
		    <td class="text bg_content" bgcolor="#FFFFFF" align="center"><p>&nbsp;</p>
			    <table class="black" border="0" width="95%" cellspacing="0" cellpadding="0">
				    <tr>
					    <td class="title_back" align="left">
					        <table class="text" border="0" width="100%" cellspacing="0" cellpadding="0">
					        <tr>
					        <td class="title_back2" width="2%">&nbsp;</td>
					        <td class="title_back2 title_white" width="30%"><asp:Label ID="LabelTitle" runat="server" Text="Label"></asp:Label></td>
					        <td><span class="title_right"></span></td>
					        </tr>
					        </table>
                        </td>
					    <td class="title_back" align="right">
					    <a class="text" href="SPADA_file_list.aspx">SPADA File List</a>&nbsp;&nbsp;
  				    </td>
    					
				    </tr>
				    <tr>
					    <td colspan="2" class="border_nobottom bg_subtitle_white">&nbsp; Upload</td>
				    </tr>
				    <tr>
				    <td class="border_nobottom" colspan="3">
				    
				        <table class="text" border="0" width="100%" cellspacing="0" cellpadding="2" id="tblFile" name="tblFile">
                            <tr>
						        <td class="bg_grid" align="right" width="25%">Version</td>
						        <td class="bg_grid2" align="left">
                                    <asp:TextBox ID="txtVersion" runat="server" width="100px" MaxLength="10" CssClass="text"></asp:TextBox>
						            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtVersion" ErrorMessage="&nbsp;File Version is Required"></asp:RequiredFieldValidator>
						        </td>
					        </tr>
                            <tr id="cellfilename" align="right">
                                <td class="bg_grid" align="right" width="25%" >
                                    File Name </td>
                                <td class="bg_grid2" align="left" style="width:400px"  >
                                    <asp:FileUpload Width="400px" CssClass="text" ID="txtFilex" runat="server" />
                                </td>
                                <td class="text" align="left">
                                    <img src="..\images\add.gif" align="absmiddle" border="0" alt="Add File" style="cursor:hand;" onclick="AddDeleteRow(tblFile,'a');" WIDTH="15" HEIGHT="16">
                                    <img id="imgRemove" src="..\images\remove.gif" align="absmiddle" border="0" alt="Remove File" style="cursor:hand;" onclick="AddDeleteRow(tblFile,'d');" WIDTH="15" HEIGHT="16"><%--style="visibility='hidden'" --%>
                                </td>
                            </tr>
                        </table>

				        <table class="text" border="0" width="100%" cellspacing="0" cellpadding="3">

					        <tr runat=server id="status" visible=false>
						        <td class="bg_grid" align="right">Status</td>
						        <td class="bg_grid2" align="left"><asp:Label ID="lblStatus" runat="server"></asp:Label></td>
					        </tr>
							    <tr>
								    <td class="border bg_footer" colspan="2" align=right>
									    <asp:Button ID="btnUpload" runat="server" Text="Upload" CssClass="buttonsmall" onclick="btnUpload_Click" />
                        <asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="buttonsmall" CausesValidation="False" onclick="btnCancel_Click" />
								    </td></tr>
				        </table>
				    </td>
				    </tr>
              </table>
	        </td>
        </tr>
    </table>
    <p>&nbsp;</p>
</asp:Content>
